<?
/**
 * Copyright 2007 Melange.
 *
 * This file is part of Melange_Framework
 *
 * PHP-MVC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * PHP-MVC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PHP-MVC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @package mvc
 *
 */


/**
 * Imports
 */
require_once("mvc/action/Action.php");


/**
 * RedirectAction class
 *
 * @category    Melange Framework
 * @package     mvc
 * @copyright   Copyright (c) 2007 Jeroen Simons. All rights reserved
 * @author      Jeroen Simons <jeroen@melange.nl>
 * @link        http://www.melange.nl/
 *
 */
class RedirectAction extends Action {
	
	
    // ----------------------------------------------------- Instance Variables
	
	/**
	 * Logger
	 *
	 * @var LogCategory
	 */
	private $log;

	
    // ----------------------------------------------------------- Constructors
    
	/**
	 * Construct new RedirectAction
	 *
	 */
	public function __construct() {
        $this->log = LoggerManager::getLogger("RedirectAction");
    }
    
    
    // --------------------------------------------------------- Public Methods

    /**
     * Execute the action
     *
     * @param ActionConfig $mapping
     * @param ActionForm $form
     * @param Request $request
     * @param Response $response
     */
    public function execute(ActionConfig &$mapping, &$form, Request &$request, Response &$response) {
    	$response->sendRedirect($mapping->findForward("success")->getPath());
    }

}